package com.sandasai.action.user;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionSupport;
import com.sandasai.service.UserManager;
@Controller
@Scope("prototype")
public class ValidEmailAction extends ActionSupport {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String email;
    private Map<String, Object> dataMap;
    @Resource
	private UserManager userManager;
    
    public Map<String, Object> getDataMap() {
        return dataMap;
    }
    public void setDataMap(Map<String, Object> dataMap) {
        this.dataMap = dataMap;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    /**
     * @return
     */
    public String execute() {
        dataMap = new HashMap<String, Object>();
        if(userManager.checkEmail(email)) {
            dataMap.put("status", "10003");
        }else {
            dataMap.put("status", "20000");
        }
        return SUCCESS;
    }
}